package com.temp.dto;

import com.temp.annotation.EmailUnique;
import com.temp.annotation.LoginNameUnique;
import com.temp.annotation.Xss;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import java.math.BigDecimal;

@Data
public class UserDTO {

    private Long id;

    @Email(message = "apiMsg.emailNotTrue")
    @EmailUnique
    @Xss(message = "apiMsg.emailXss")
    private String email;

    @Length(min = 6, max = 20, message = "apiMsg.passwordRange,6~20")
    @Xss(message = "apiMsg.passwordXss")
    private String password;

    @Length(min = 4, max = 20, message = "apiMsg.userNameRange,4~20")
    @LoginNameUnique
    @Xss(message = "apiMsg.usernameXss")
    private String username;

    private String description;

    private String avatarUrl;

    private String paypalAccount;

    private Integer donationCount;

    private BigDecimal donationTotal;

    private Integer campaignCount;

    private BigDecimal balance;

    private Long roleId;
}
